//
//  videoHeaderCollectionViewCell.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "videoHeaderCollectionViewCell.h"

@implementation videoHeaderCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.imageHead mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(@10);
        make.left.mas_equalTo(@10);
        make.width.equalTo(@(self.bounds.size.width - 20));
        make.height.equalTo(@(self.bounds.size.width - 20));
    }];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.imageHead.mas_bottom);
        make.left.mas_equalTo(@0);
        make.right.mas_equalTo(@0);
        make.bottom.mas_equalTo(self.mas_bottom);
    }];
}

- (void)createSubviews
{
    self.imageHead = [UIImageView new];
    self.imageHead.layer.cornerRadius = (self.bounds.size.width - 20) / 2;
    self.imageHead.layer.masksToBounds = YES;
    [self.contentView addSubview:self.imageHead];
    
    self.titleLab = [UILabel new];
    self.titleLab.font = [UIFont systemFontOfSize:18];
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.titleLab];
}

@end
